package com.schoolai.schoolstudy.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.schoolai.entity.SchoolStudyEnglishWorkTask;
import com.schoolai.entity.SchoolStudyEnglishWorkTaskList;
import com.schoolai.schoolstudy.mapper.SchoolStudyEnglishWorkTaskListMapper;
import com.schoolai.schoolstudy.req.SchoolStudyEnglishWorkTaskListREQ;
import com.schoolai.schoolstudy.service.SchoolStudyEnglishWorkTaskListService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.schoolai.util.base.BaseRequest;
import com.schoolai.util.base.Result;
import io.micrometer.common.util.StringUtils;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author bobby
 * @since 2025-09-29
 */
@Service
public class SchoolStudyEnglishWorkTaskListServiceImpl extends ServiceImpl<SchoolStudyEnglishWorkTaskListMapper, SchoolStudyEnglishWorkTaskList> implements SchoolStudyEnglishWorkTaskListService {


    @Override
    public Result queryPage(SchoolStudyEnglishWorkTaskListREQ req) {
        LambdaQueryWrapper<SchoolStudyEnglishWorkTaskList> wrapper = new LambdaQueryWrapper<>();
        if(StringUtils.isNotBlank(req.getTaskId())){
            // wrapper.like("work_task_name", req.getWorkTaskName());
            wrapper.like(SchoolStudyEnglishWorkTaskList::getTaskId, req.getTaskId());
        }

        return Result.ok(baseMapper.selectPage(req.getPage(), wrapper));
    }
}
